﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Protegidos/Administracao/GENTE_Adm.master" AutoEventWireup="true" CodeFile="acAltContratoVigencia.aspx.cs" Inherits="Protegidos_Administracao_Cadastros_acAltContratoVigencia" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cphSubConteudo" Runat="Server">

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
    function ShowEditForm(id, rowIndex) {
        var grid = $find("<%= RadGrid1.ClientID %>");

        var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
        grid.get_masterTableView().selectItem(rowControl, true);

        window.radopen("_popup/acPesqGestor.aspx?IdGestor=" + id, "UserListDialog");
        return false;
    }
    function ShowInsertGestor() {
        var id = document.getElementById('<%= hdId.ClientID %>').value;
        window.radopen("_popup/acpIncluirGestorContrato.aspx?IdContrato=" + id, "InsertGestor");
        return false;
    }
    function ShowInsertContAditivo() {
        var id = document.getElementById('<%= hdId.ClientID %>').value;
        window.radopen("_popup/acpIncluirContratoAditivo.aspx?IdContrato=" + id, "InsertAditivo");
        return false;
    }
    function refreshGrid(arg) {
        if (!arg) {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindGestor");
        }
        else {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindContrato");
        }
    }
</script>
</telerik:RadCodeBlock>  

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Telerik" >
    <Windows>
        <telerik:RadWindow  ID="InsertGestor" runat="server" Title="Incluir Gestor" Height="400px"
            Width="500px" Left="400px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"   />
        <telerik:RadWindow  ID="InsertAditivo" runat="server" Title="Incluir aditivo contratual" Height="400px"
            Width="500px" Left="400px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"   />
    </Windows>
</telerik:RadWindowManager>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
    </telerik:AjaxSetting>      
    <telerik:AjaxSetting AjaxControlID="RadGrid1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
    </telerik:AjaxSetting>     
    <telerik:AjaxSetting AjaxControlID="RadGrid2">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
    </telerik:AjaxSetting>                                                           
</AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Telerik" >
</telerik:RadAjaxLoadingPanel> 

<table width="99%" align="center">
    <tr>
        <td>
              
            <div class="Titulo01">Vigência</div>
            <div class="Titulo02">Cadastros / Gerais / Contratos</div>

        </td>    
    </tr>
    <tr>
        <td>
        
        <table width="99%" align="right">
            <tr>
                <td>
                    <div class="SuTituloVR">Contrato</div>
                </td>
            </tr>
            <tr>
                <td>
                
                    <table width="100%" align="right" class="textoCZ_12" > 
                        <tr runat="server">
                            <td>
                                <asp:Label ID="lblTitulo" runat="server" Text=""></asp:Label>&nbsp;&nbsp;
                                <a runat="server" id="lnkImage" href="#" target="_blank"><img alt="" src="" style="height: 10px; width: 10px" /></a>
                            </td>
                        </tr>
                    </table>
                
                </td>
            </tr>
            <tr>
                <td>
                    <div class="SuTituloVR">Vigência</div>
                </td>
            </tr>
            <tr>
                <td>
                    
                    <table width="100%" align="right" class="textoCZ_12" > 
                        <tr runat="server">
                            <td style="width: 110px">Início:</td>
                            <td>
                                <asp:Label ID="lblInicio" runat="server" Text=""></asp:Label>
                                <input runat="server" id="hdId" type="hidden" value="1" />
                            </td>
                        </tr>
                        <tr id="Tr1" runat="server">
                            <td style="width: 110px">Término:</td>
                            <td>
                                <asp:Label ID="lblTermino" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr id="Tr2" runat="server">
                            <td style="width: 110px">Prorrogado até:</td>
                            <td>
                                <asp:Label ID="lblProrrogado" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr id="Tr3" runat="server">
                            <td style="width: 110px">Rescindido em:</td>
                            <td>
                                <asp:Label ID="lblRescindido" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                    </table>
                    
                </td>
            </tr>
            <tr>
                <td>
                    <div class="SuTituloVR">Atualizações</div>
                </td>
            </tr>
            <tr>
                <td>
                
                    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="100%" Skin="Telerik" >
                    <PagerStyle Mode="NumericPages" />
                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="IdContratoAditivo" ClientDataKeyNames="IdContratoAditivo" Width="100%" CommandItemDisplay="Top" PageSize="5">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Descricao" HeaderText="Descricao" ReadOnly="True" SortExpression="Descricao" UniqueName="Descricao"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TipoAditivo.Descricao" HeaderText="TipoAditivo.Descricao" SortExpression="TipoAditivo.Descricao" UniqueName="TipoAditivo.Descricao"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DataInicio" HeaderText="DataInicio" SortExpression="DataInicio" UniqueName="DataInicio"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DataFim" HeaderText="DataFim" SortExpression="DataFim" UniqueName="DataFim"></telerik:GridBoundColumn>
                            <telerik:GridHyperLinkColumn DataTextFormatString="Vizualizar"
                                DataNavigateUrlFields="Path" UniqueName="Path" DataNavigateUrlFormatString="http://localhost/gentev1/{0}" Target="_blank"
                                HeaderText="Imagem" DataTextField="Path">
                            </telerik:GridHyperLinkColumn>
                        </Columns>
                        <CommandItemTemplate>
                            <!-- -->
                            <table border="0" style="width: 100%;" class="rgCommandTable">
                                <tbody>
                                    <tr>
                                        <td align="left">
                                            <input class="rgAdd" type="button" title=" Incluir aditivo contratual" onclick="return ShowInsertForm();" />
                                            <a href="#" onclick="return ShowInsertContAditivo();"> Incluir aditivo contratual</a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <!-- -->
                        </CommandItemTemplate>
                    </MasterTableView>
                </telerik:RadGrid>
                
                </td>
            </tr>
            <tr>
                <td>
                    <div class="SuTituloVR">Gestor(es)</div>
                </td>
            </tr>
            <tr>
                <td>
                
                <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True" Width="100%" ondeletecommand="RadGrid2_DeleteCommand" Skin="Telerik" >
                    <PagerStyle Mode="NumericPages" />
                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="IdContratoGestor" ClientDataKeyNames="IdContratoGestor" Width="100%" CommandItemDisplay="Top" PageSize="5">
                        <Columns>
                            <telerik:GridBoundColumn DataField="IdContratoGestor" HeaderText="IdContratoGestor" ReadOnly="True" SortExpression="IdContratoGestor" UniqueName="IdContratoGestor"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Pessoa.Matricula" HeaderText="Pessoa.Matricula" SortExpression="Pessoa.Matricula" UniqueName="Pessoa.Matricula"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Pessoa.NomeCompleto" HeaderText="Pessoa.NomeCompleto" SortExpression="Pessoa.NomeCompleto" UniqueName="Pessoa.NomeCompleto"></telerik:GridBoundColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Remover" CommandName="Delete" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="60px"></telerik:GridButtonColumn>
                        </Columns>
                        <CommandItemTemplate>
                            <!-- -->
                            <table border="0" style="width: 100%;" class="rgCommandTable">
                                <tbody>
                                    <tr>
                                        <td align="left">
                                            <input class="rgAdd" type="button" title=" Adicionar Gestor" onclick="return ShowInsertForm();" />
                                            <a href="#" onclick="return ShowInsertGestor();">Incluir Gestor</a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <!-- -->
                        </CommandItemTemplate>
                    </MasterTableView>
                </telerik:RadGrid>
                
                </td>
            </tr>
            <tr>
                <td align="right">
                <br />
                    <a href="acContratoVigencia.aspx">Voltar</a>
                </td>
            </tr>
        </table>
        </td>    
    </tr>
</table>

</asp:Content>

